package com.hsh.server.project.bank.service.impl;

import java.util.List;

import com.hsh.server.interceptor.UserUtils;
import com.hsh.server.project.bank.domain.TAppDetails;
import com.hsh.server.project.bank.mapper.TAppDetailsMapper;
import com.hsh.server.project.bank.service.ITAppDetailsService;
import com.hsh.server.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 对账明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class TAppDetailsServiceImpl implements ITAppDetailsService
{
    @Autowired
    private TAppDetailsMapper tAppDetailsMapper;

    /**
     * 查询对账明细
     * 
     * @param id 对账明细主键
     * @return 对账明细
     */
    @Override
    public TAppDetails selectTAppDetailsById(Long id)
    {
        return tAppDetailsMapper.selectTAppDetailsById(id);
    }

    /**
     * 查询对账明细列表
     * 
     * @param tAppDetails 对账明细
     * @return 对账明细
     */
    @Override
    public List<TAppDetails> selectTAppDetailsList(TAppDetails tAppDetails)
    {
        tAppDetails.setId(UserUtils.getUserInfo().getId());
        return tAppDetailsMapper.selectTAppDetailsList(tAppDetails);
    }

    /**
     * 新增对账明细
     * 
     * @param tAppDetails 对账明细
     * @return 结果
     */
    @Override
    public int insertTAppDetails(TAppDetails tAppDetails)
    {
        tAppDetails.setCreateTime(DateUtils.getNowDate());
        return tAppDetailsMapper.insertTAppDetails(tAppDetails);
    }

    /**
     * 修改对账明细
     * 
     * @param tAppDetails 对账明细
     * @return 结果
     */
    @Override
    public int updateTAppDetails(TAppDetails tAppDetails)
    {
        return tAppDetailsMapper.updateTAppDetails(tAppDetails);
    }

    /**
     * 批量删除对账明细
     * 
     * @param ids 需要删除的对账明细主键
     * @return 结果
     */
    @Override
    public int deleteTAppDetailsByIds(Long[] ids)
    {
        return tAppDetailsMapper.deleteTAppDetailsByIds(ids);
    }

    /**
     * 删除对账明细信息
     * 
     * @param id 对账明细主键
     * @return 结果
     */
    @Override
    public int deleteTAppDetailsById(Long id)
    {
        return tAppDetailsMapper.deleteTAppDetailsById(id);
    }
}
